To keep a persistent connection link between a client and a server normal, a device on which the client resides sets some timers for periodical timing. Each time a timing end moment set by the timer arrives, the device sends a heartbeat packet to the server, and initiates heartbeat packet interaction with the server in order to determine that the persistent connection link between the client and the server is normal. These timers used to time the device when the device sends the heartbeat packet are heartbeat packet timers. When a timing end moment of a heartbeat packet timer comes, even if the device is in a standby state, the device is awakened. As there are increasingly more clients (which may also be applications or processes running in the device) that have different functions on the device, heartbeat packet timers set by the device also continuously increase. As a result, the device is frequently awakened, greatly affecting standby power consumption of the device.
To reduce the standby power consumption of the device, the heartbeat packet timer may be turned off in some scenarios, or duration of a timing period of the heartbeat packet timer is increased. Because a relatively large quantity of timers are set by the device, the heartbeat packet timer needs to be accurately identified. However, in some other approaches, a quantity of arrival times of a timing end moment of a timer is generally counted in a period of time. When the quantity of times exceeds a preset value, it is determined that the timer is a heartbeat packet timer. It is conceivable that, some timers set by the device may repeatedly perform timing only for implementing a particular function of the device, and these timers are not heartbeat packet timers. Therefore, when the other approaches identify whether a timer is a heartbeat packet timer, an identification error easily occurs, affecting working performance of the device.